<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>『 知音培训信息管理平台』</title>
	<script type="text/javascript" src="__PUBLIC__/Resourse/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="__PUBLIC__/Resourse/js/jquery.cookie.js"></script>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Resourse/themes/default/easyui.css" id="easyuiTheme">
	<script type="text/javascript" charset="UTF-8" src="__PUBLIC__/Resourse/js/changeEasyuiTheme.js"></script>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Resourse/themes/icon.css">
	<script type="text/javascript" src="__PUBLIC__/Resourse/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Resourse/locale/easyui-lang-zh_CN.js"></script>
	<style type="text/css">
		body {
			margin:0px;
			padding:0px;
			width:100%;
			height:100%;
		}
		.formStyle{  
            margin:0;  
            padding:10px 10px 30px 5px;  
       }  
       .ftitle{  
            font-size:14px;  
            font-weight:bold;  
            padding:5px 0;  
            margin-bottom:10px;  
            border-bottom:1px solid #ccc;  
        }  
       .fitem{  
            margin-bottom:5px;  
       }  
        .fitem label{  
           display:inline-block;  
            width:80px;  
        }
        .formText {
        	width : 200px;
        }  
	</style>
	<script type="text/javascript">
		var flUrl ="";
		var itemUrl="";
		
		$(function() {		
			$(window).resize(function(){
				$('#dg').datagrid('resize');
			});
			
			//设置分页控件   
		    var p = $('#dg').datagrid('getPager');  
		    $(p).pagination({  
		        pageSize: 10,//每页显示的记录条数，默认为10   
		        pageList: [20,30,40],//可以设置每页记录条数的列表   
		        beforePageText: '第',//页数文本框前显示的汉字   
		        afterPageText: '页    共 {pages} 页',  
		        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',  
		        /*onBeforeRefresh:function(){ 
		            $(this).pagination('loading'); 
		            alert('before refresh'); 
		            $(this).pagination('loaded'); 
		        }*/  
		    });  
		    
		    //课程combogrid
		    $('#KCMC').combogrid({
					panelWidth:550,
					idField:'Id', //ID字段
				    textField:'KC_BJMC', //显示的字段
				    url:"__URL__/courseList/",
				    fitColumns: true,  
		            striped: true,  
		            editable:true,  
		            pagination : true,//是否分页  
		            rownumbers:true,//序号  
		            collapsible:false,//是否可折叠的  
		            fit: true,//自动大小  
		            pageSize: 10,//每页显示的记录条数，默认为10  
		            pageList: [10,15],//可以设置每页记录条数的列表  
		            method:'post',  
					afterPageText: '页    共 {pages} 页',  
				    columns:[[
						{field:'Id',title:'编号',hidden:true,width:100},
				        {field:'KC_BJMC',title:'班级名称',width:100},
				        {field:'KC_KMBH',title:'科目编号',width:100},
				        {field:'KC_ZRS',title:'总人数',width:80},
				        {field:'KC_YBRS',title:'已报人数',width:80},
				        {field:'KC_KCFY',title:'课程费用',width:80},
				        {field:'KC_ZK',title:'折扣',width:80},
				        {field:'KC_SKSJ',title:'上课时间',width:100}
				    ]],
				    onSelect:function(sel,obj){
				    	 //$("#LS_KCJG").val(obj.KC_KCFY);//课程价格
				    	 //$("#LS_KCLX").val(obj.KC_KMBH);//课程编号
				    	 //$("#LS_ZK").val(obj.KC_ZK);//课程折扣
				    },
				    keyHandler: {
		                up: function() {},
		                down: function() {},
		                enter: function() {},
		                query: function(q) {
		                    //动态搜索
		                    $('#KCMC').combogrid("grid").datagrid("reload", {
		                    																'KCMC': q ,
		                    																'XQ': $('#XQ').combobox('getValue'),
		                    																'KMBH': $('#KMBH').combobox('getValue'),
		                    																'NJ': $('#NJ').combobox('getValue'),
		                    																});
		                    $('#KCMC').combogrid("setValue", q);
		                }
		            }
		        });  
			
			    $('#XQ').combobox({
			    	onSelect: function(obj){
			    		doCombSearch();
			    	}
			    });
		    
			    $('#KMBH').combobox({
			    	onSelect: function(obj){
			    		doCombSearch();
			    	}
			    });
			    
			    $('#NJ').combobox({
			    	onSelect: function(obj){
			    		doCombSearch();
			    	}
			    });

		});
		
		$(document).ready(function(){	
			var skin = $.cookie('easyuiThemeName');
			if (skin != null && typeof skin != undefined) {
				changeThemeFun(skin);
			}
			//expandAll();		
		});
		
	       
      function reloadDataGrid(){
    	  var flId= $('#ccItem').combotree('getValue');
          if (flId) {
				var queryParams = $('#dg').datagrid('options').queryParams;  
		        queryParams.PARENT_ID = flId;  
		        //重新加载datagrid的数据  
		        $("#dg").datagrid('reload');  
          }else {
        	  $("#dg").datagrid('reload');   
          }
      }
       
      
	function doSearch(){
		$('#dg').datagrid('reload',{
			XQ: $('#XQ').combobox('getValue'),
			KMBH: $('#KMBH').combobox('getValue'),
			NJ: $('#NJ').combobox('getValue'),
			KCID: $('#KCMC').combobox('getValue'),
		});
	}
	
	function doCombSearch(){
        $('#KCMC').combogrid("grid").datagrid("reload", {
			'XQ': $('#XQ').combobox('getValue'),
			'KMBH': $('#KMBH').combobox('getValue'),
			'NJ': $('#NJ').combobox('getValue'),
		});
	}
	


	</script>
</head>
<body class="easyui-layout" style="border-width:50px;margin:0">
	<div id="mainPanle"  region="center"  border="false" >
		<table id="dg" class="easyui-datagrid" style="margin:0" 
							data-options="title:'学生列表',rownumbers:true,singleSelect:true,
												height:'auto',fit:true,loadMsg:'数据加载中请稍后……',  
												autoRowHeight:false,pagination:true,
												pageSize:10,url:'__URL__/studentList',toolbar:'#tb' ">
			<thead>
				<tr>
					<th data-options="field:'Id',fitColumns: true,hidden:true">ID</th>
					<th data-options="field:'XS_XH',fitColumns: true,width:140,align:'center'">学号</th>
					<th data-options="field:'XS_XM',fitColumns: true,width:80,align:'center'">姓名</th>
					<th data-options="field:'XS_PY',fitColumns: true,width:80,align:'center'">拼音</th>
					<th data-options="field:'XS_XB',fitColumns: true,width:80,align:'center',formatter:function(value,rowData,rowIndex){ if(value == 'F'){ return '男'} else if(value =='M') { return '女'} else { return '保密'}}">性别</th>
					<th data-options="field:'XS_CSRQ',itColumns: true,width:120,align:'center'">出生日期</th>
					<th data-options="field:'XS_RXRQ',itColumns: true,width:120,align:'center'">入学日期</th>
					<th data-options="field:'XS_XX',itColumns: true,width:160,align:'center'">就读学校</th>
					<th data-options="field:'XS_NJ',itColumns: true,width:80,align:'center'">年级</th>
					<th data-options="field:'XS_BJ',itColumns: true,width:80,align:'center'">班级</th>
					<th data-options="field:'XS_JZXM',itColumns: true,width:80,align:'center'">家长姓名</th>
					<th data-options="field:'XS_JZDH',itColumns: true,width:80,align:'center'">家长电话</th>
					<th data-options="field:'XS_JTZZ',itColumns: true,width:200,align:'center'">家庭住址</th>
					<th data-options="field:'XS_ZT',itColumns: true,width:80,align:'center',formatter:function(value,rowData,rowIndex){ if(value == '1'){ return '活跃'} else { return '冻结'}}">状态</th>
				</tr>
			</thead>
		</table>
		<div id="tb" style="padding:5px;height:auto">
			<div id="searchDiv">
		    	<div style="margin-bottom:3px;">  
		        	<label>校&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区: </label><input class="easyui-combobox" id="XQ" name="XQ" data-options="valueField:'ITEM_KEY',textField:'text',url:'__URL__/getDictList/flValue/XQ'">
		    		<label>科&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目:</label><input class="easyui-combobox" id="KMBH" name="KMBH" data-options="valueField:'ITEM_KEY',textField:'text',url:'__URL__/getDictList/flValue/KM'">  
		        	<label>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级:</label><input class="easyui-combobox" id="NJ" name="NJ" data-options="valueField:'ITEM_KEY',textField:'text',url:'__URL__/getDictList/flValue/JDNJ'">  
		        	<label>课程班级名称:</label><input id="KCMC" name="KCMC" class="easyui-combobox" >   
		        	<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="doSearch()">Search</a>  
		    	</div> 
	    	</div>
	    	
		</div>
	</div>
</body>
</html>